<?php
session_start();

include("../includes/custom/bal_sharepoint.php");

            $username = $_POST["username"];
            $password = $_POST["password"];
            $login_host = "http://192.168.5.9:2012/sites/Geip/_vti_bin/ListData.svc/";
            $host = "http://192.168.5.9:2012/sites/Geip/_vti_bin/ListData.svc/";
            
            $bal_login = new BAL();

            $auth_result = $bal_login->checkCredentials($username, $password, $login_host);

            $location = "../library.php";

            if($auth_result != 0)
            {
                $bal_login->setProperties($username, $password, $host, "MyContacts");

                $_SESSION["username"] = $username;
                $_SESSION["password"] = $password;
            }
            else
            {
                $location = "../login.php";
            }

            header("Location: " . $location);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login - Bitzer</title>
</head>
<body>
        
</body>
</html>